var mysql = require('mysql'); 
var TEST_TABLE = 'user';  

//创建连接  
var client = mysql.createConnection({
  host: '127.0.0.1',
  user: 'root',  
  password: 'root',
  database: 'pysql'
});

client.connect();

mysql.query = function(sql, callback){  
  
    if (!sql) {  
        callback();  
        return;  
    }  
    client.query(sql, function(err, rows, fields) {  
      if (err) {  
        console.log(err);  
        callback(err, null);  
        return;  
      };  
  
      callback(null, rows, fields);  
    });  
}  
module.exports = mysql;